An error correcting code (ECC) is implemented in a non-volatile memory (e.g., a flash memory) to improve the reliability of data stored in the non-volatile memory. That is, the ECC is generated and stored in the non-volatile memory as the data is written to the non-volatile memory. Subsequently, when the data is read, the ECC is processed using an ECC circuit to determine whether the data has been corrupted. If the ECC circuit detects an error in the data, the data is repaired before it is forwarded for processing.
Since the memory is divided into multiple data areas, such as sectors, a unit of the data area is linked with its respective ECC stored in a designated area of the non-volatile memory. For example, a 9 bit ECC area is allotted for each unit of 256 bit data area in a NAND flash memory. However, currently, the 9 bit ECC area can be programmed only once during initial programming of the unit data area. Thus, even if the initial programming leaves a sizable blank space, additional programming of the blank space is not permitted. This, in turn, results in a waste of the memory space.